{% load static %}
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>Online Store</title>
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
        <link href="{% static 'css/base.css' %}" rel="stylesheet">
    </head>
    <body>
        <div id="header">
            <a href="/" class="logo">Online Store</a>
        </div>
        <div id="subheader">
            {% if request.user.is_authenticated %}
                <div class="cart">
                    {% with total_items=cart|length %}
                    {% if cart|length > 0 %}
                    Your cart:
                    <a href="{% url "cart:display_cart" %}">
                        {{ total_items }} item{{ total_items|pluralize }},
                        ${{ cart.get_total_price }}
                    </a>
                    {% else %}
                    Your cart is empty.
                    {% endif %}
                    {% endwith %}
                </div>
            {% else %}
                You is not authorized
            {% endif %}
        </div>
        <div id="content">
            {% block content %}
            {% endblock %}
        </div>
    </body>
</html>
